import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    { path: '/', name: 'home', component: () => import('@/components/HelloWorld.vue')},
    { path: '/aa', name: 'aa', component: () => import('@/components/Test.vue') }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

// router.beforeEach((to) => {
//     // ✅ 这将起作用，因为路由器在之后开始导航
//      // 路由已安装，pinia 也将安装
//     const store = aaa()
//     console.log('router', store.count)
//     // if (to.meta.requiresAuth && !store.isLoggedIn) return '/login'
// })
export default router